home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / WHEREX.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  409 b   |  22 lines

  1. /* p898.c --- bible */
  2. #include <conio.h>
  3. #include <stdlib.h>
  4. #define ESC '\033'
  5. main()
  6. {
  7.     int xpos, ypos = 5, c = 0;
  8.     cprintf("Press ESC to exit");
  9.     while(c != ESC)
  10.     {
  11.         clrscr();
  12.         gotoxy(1, 1);
  13.         cprintf("Press ESC to exit");
  14.         randomize();
  15.         gotoxy(random(40), ypos);
  16.         xpos = wherex();
  17.         putch('X');
  18.         gotoxy(1, 12);
  19.         cprintf("The 'X' is at position %d", xpos);
  20.         c = getch();
  21.     }
  22. }